﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO.Ports;
using System.Text.RegularExpressions;
using System.Threading;
using System.Reflection; // 引用这个才能使用Missing字段
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Web;
using System.Runtime.InteropServices;
using CCWin;
namespace weiqijiance
{
    public partial class shebeibiaoding : CCSkinMain
    {
        // /声明INI文件的写操作函数 WritePrivateProfileString()
        [DllImport("kernel32")]
        private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);

        //声明INI文件的读操作函数 GetPrivateProfileString()
        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
        private string sPath = null;

        public static string registCode;

        public mainform m_mainform;

        public shebeibiaoding()
        {
            registCode = "";
            InitializeComponent();
        }
        //ini文件
        public void Ini(string path)
        {
            this.sPath = path;
        }
        public void Writue(string section, string key, string value)
        {
            // section=配置节，key=键名，value=键值，path=路径
            WritePrivateProfileString(section, key, value, sPath);
        }
        public string ReadValue(string section, string key)
        {
            // 每次从ini中读取多少字节
            System.Text.StringBuilder temp = new System.Text.StringBuilder(255);

            // section=配置节，key=键名，temp=上面，path=路径
            GetPrivateProfileString(section, key, "", temp, 255, sPath);
            return temp.ToString();
        }


        public void xinxichushihua()
        {
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + path + "\\授权码.ini";
            string path1 = string.Format(@"{0}", path);
            Ini(path1);


            registCode = ReadValue("授权码", "授权码1");


        }
       

        private void skinBut_hzh_Click(object sender, EventArgs e)
        {
            JDHengJiaZai obj = new JDHengJiaZai();       
            obj.m_mainform = m_mainform;   
            obj.ShowDialog();
        }

        private void skinBut_bzh_Click(object sender, EventArgs e)
        {
            JDBianJiaZai obj = new JDBianJiaZai();
            obj.m_mainform = m_mainform;
            //this.Close();
            obj.ShowDialog();
        }

        private void skinBut_speed_Click(object sender, EventArgs e)
        {
            JDspeed obj = new JDspeed();
            obj.m_mainform = m_mainform;
            //  this.Close();
            obj.ShowDialog();
        }

        private void skinBut_GL_Click(object sender, EventArgs e)
        {
            JDGuangliang obj = new JDGuangliang();
            obj.m_mainform = m_mainform;
            //this.Close();
            obj.ShowDialog();
        }

        private void skinBut_neizu_Click(object sender, EventArgs e)
        {
            JDNeiZu obj = new JDNeiZu();
            obj.m_mainform = m_mainform;
            //   this.Close();
            obj.ShowDialog();
        }


        private void skinBut_wendu_Click(object sender, EventArgs e)
        {
            wendu obj = new wendu();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }


        private void skinBut_yure_Click(object sender, EventArgs e)
        {
            yure obj = new yure();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

        private void skinBut_jzxxsj_Click(object sender, EventArgs e)
        {
           
            国标自检类.JDXiangYSJ obj = new 国标自检类.JDXiangYSJ();
            obj.m_mainform = m_mainform;
            obj.ShowDialog();
        }

    }
}
